package com.pingxx.boot.demo.config;


import com.pingxx.boot.demo.kafka.TopicConsts;
import org.apache.kafka.clients.admin.NewTopic;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.kafka.annotation.EnableKafka;

@EnableKafka
@Configuration
public class KafkaConfig {

    private final short replicationFactor = -1;

    @Bean
    public NewTopic userTopic() {
        return new NewTopic(TopicConsts.USER_TOPIC, -1, replicationFactor);
    }
}
